struct zwp_text_input_v3 *text_input;
GtkIMContext *current;
+
+ guint serial;
};
struct _GtkIMContextWaylandClass
enum zwp_text_input_v3_change_cause surrounding_change;
- guint serial;
-
struct surrounding_delete pending_surrounding_delete;
struct preedit current_preedit;
struct zwp_text_input_v3 *text_input,
uint32_t serial)
{
- GtkIMContextWayland *context;
GtkIMContextWaylandGlobal *global = data;
gboolean result;
gboolean valid;
if (!global->current)
return;
- context = GTK_IM_CONTEXT_WAYLAND (global->current);
-
- valid = serial == context->serial;
+ valid = serial == global->serial;
text_input_delete_surrounding_text_apply(global, valid);
text_input_commit_apply(global, valid);
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
global->text_input =
zwp_text_input_manager_v3_get_text_input (global->text_input_manager,
gdk_wayland_seat_get_wl_seat (seat));
+ global->serial = 0;
zwp_text_input_v3_add_listener (global->text_input,
&text_input_listener, global);
}
{
if (global->current != GTK_IM_CONTEXT (context))
return;
- context->serial++;
+ global->serial++;
zwp_text_input_v3_commit (global->text_input);
context->surrounding_change = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD;
}